home *** CD-ROM | disk | FTP | other *** search
/ Web Star/List Star - Eve…he Ultimate Internet Site / StarNine Internet Pubisher (Web Star and List Star)(StarNine)(1995).iso / ListSTAR™ / Tools and Enhancments / RFC Triggers / Speak X-Planation < prev   
Encoding:
Text File  |  1995-08-01  |  2.6 KB  |  63 lines  |  [TEXT/ToyS]

  1. -----------------------------------------------------------------------
  2. -- StarNine Technologies, Inc., hereby disclaims all copyright interest
  3. -- in the following source code.
  4. -- 
  5. -- This source code is free and has been placed into the public domain.
  6. -- You can redistribute it, modify it (including these comments) and/or
  7. -- create derivative works from it as you see fit.
  8. --
  9. -- This source code is made available in the hope that it will be useful,
  10. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. -----------------------------------------------------------------------
  13.  
  14. (* UNCOMMENT FOR TESTING *)
  15. --property s9MailFileName : "test message"
  16. (* END TESTING SECTION *)
  17.  
  18. property action_succeeds : 0
  19. property action_error : -1
  20.  
  21. property spool_folder : ""
  22.  
  23. try
  24.     tell application "Finder"
  25.         if (exists of item spool_folder) is false then --see if stored property is valid
  26.             if exists of item ((startup disk as string) & "ListSTAR/SMTP:ListSTAR Server") then
  27.                 copy (startup disk as string) & "ListSTAR/SMTP:Message Spool/SMTP:" to spool_folder
  28.             else if exists of item ((startup disk as string) & "ListSTAR/MS:ListSTAR Server") then
  29.                 copy (startup disk as string) & "ListSTAR/MS:Message Spool/MS:" to spool_folder
  30.             else if exists of item ((startup disk as string) & "ListSTAR/POP:ListSTAR Server") then
  31.                 copy (startup disk as string) & "ListSTAR/POP:Message Spool/POP:" to spool_folder
  32.             else if exists of item ((startup disk as string) & "ListSTAR/QM:ListSTAR Server") then
  33.                 copy (startup disk as string) & "ListSTAR/QM:Message Spool/QM:" to spool_folder
  34.             else
  35.                 error "The Spool Folder could not be found." number 100
  36.             end if
  37.         end if
  38.         if (exists of file (spool_folder & s9MailFileName)) is false then --check spool file
  39.             error "There is a problem with the spool file." number 101
  40.         end if
  41.         set theFile to open for access file (spool_folder & s9MailFileName) --open file for reading
  42.         set theLine to "Start" --initialize theLine
  43.         repeat while (the first character of theLine) is not return
  44.             set theLine to read theFile until return --read in one line
  45.             ignoring case
  46.                 if theLine contains "X-Planation:" then
  47.                     speak theLine
  48.                     exit repeat
  49.                 end if
  50.             end ignoring
  51.         end repeat
  52.         close access theFile
  53.     end tell
  54.     return action_succeeds
  55. on error errMsg number errNum
  56.     close access theFile
  57.     if errNum is not -39 then --check for end of file
  58.         display dialog (errMsg & return & errNum) buttons {"Cancel"} default button "Cancel" with icon stop
  59.         return action_error
  60.     else --reached end of file 
  61.         return action_succeeds
  62.     end if
  63. end try